home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / DHTML - Document Effects / top-down-strupy.izs < prev    next >
Text File  |  2005-08-31  |  5KB  |  196 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Top-Down Stripy Curtain Script
  4. <!/TITLE>
  5.  
  6. <!BROWSER>FF1+ IE5+ Opr7+<!/BROWSER>
  7.  
  8. <!DESCRIPTION>A script that opens up a "curtain" (up-down) as the surfer enters the page.
  9. <!/DESCRIPTION> 
  10.  
  11. <!CATEGORY>document effects<!/CATEGORY>
  12.  
  13. <!SCRIPT>
  14. <!-- START OF SCRIPT -->
  15. <!-- Step 1: Insert the following into the <head> section of your page. You can change the color of the strips from green to another by changing all three instances of the word "green" to another color name: -->
  16. <style>
  17. <!--
  18. .intro{
  19. position:absolute;
  20. left:0;
  21. top:0;
  22. layer-background-color:green;
  23. background-color:green;
  24. border:0.1px solid green;
  25. z-index:10;
  26. }
  27. -->
  28. </style>
  29. <!-- Step 2: Finally, insert the below right after the <body> tags, before anything else. You can adjust the speed in which the curtain "draws' by changing "speed=20" in the second line to another number (greater is faster): -->
  30. <div id="i1" class="intro"></div><div id="i2" class="intro"></div><div id="i3"
  31. class="intro"></div><div id="i4" class="intro"></div><div id="i5" class="intro"></div><div
  32. id="i6" class="intro"></div><div id="i7" class="intro"></div><div id="i8" class="intro"></div>
  33. <script language="JavaScript1.2">
  34.  
  35. /*
  36. Top-Down Curtain Script- ⌐ Dynamic Drive (www.dynamicdrive.com)
  37. For full source code, 100's more free DHTML scripts, and TOS,
  38. visit http://www.dynamicdrive.com
  39. */
  40.  
  41. var ns4=document.layers?1:0
  42. var ie4=document.all?1:0
  43. var ns6=document.getElementById&&!document.all?1:0
  44.  
  45. var speed=20
  46. var temp=new Array()
  47. var temp2=new Array()
  48. if (ns4){
  49. for (i=1;i<=8;i++){
  50. temp[i]=eval("document.i"+i+".clip")
  51. temp2[i]=eval("document.i"+i)
  52. temp[i].width=window.innerWidth/8-0.3
  53. temp[i].height=window.innerHeight
  54. temp2[i].left=(i-1)*temp[i].width
  55. }
  56. }
  57. else if (ie4||ns6){
  58. var clipbottom=ns6?window.innerHeight:document.body.offsetHeight
  59. cliptop=0
  60. for (i=1;i<=8;i++){
  61. temp[i]=ns6?document.getElementById("i"+i).style:eval("document.all.i"+i+".style")
  62. temp[i].width=ns6?window.innerWidth/8-2:document.body.clientWidth/8
  63. temp[i].height=ns6?window.innerHeight:document.body.offsetHeight
  64. temp[i].left=(i-1)*parseInt(temp[i].width)
  65. }
  66. }
  67. function openit(){
  68. window.scrollTo(0,0)
  69. if (ns4){
  70. for (i=1;i<=8;i=i+2)
  71. temp[i].bottom-=speed
  72. for (i=2;i<=8;i=i+2)
  73. temp[i].top+=speed
  74. if (temp[2].top>window.innerHeight)
  75. clearInterval(stopit)
  76. }
  77. else if (ie4||ns6){
  78. clipbottom-=speed
  79. for (i=1;i<=8;i=i+2){
  80. temp[i].clip="rect(0 auto "+clipbottom+" 0)"
  81. }
  82. cliptop+=speed
  83. for (i=2;i<=8;i=i+2){
  84. temp[i].clip="rect("+cliptop+" auto auto auto)"
  85. }
  86. if (clipbottom<=0){
  87. if (ns6){
  88. for (i=1;i<=8;i++)
  89. temp[i].display="none"
  90. }
  91. clearInterval(stopit)
  92. }
  93. }
  94. }
  95. function gogo(){
  96. stopit=setInterval("openit()",100)
  97. }
  98. gogo()
  99. </script>
  100.  
  101. <!-- END OF SCRIPT -->
  102. <!/SCRIPT>
  103.  
  104. <!PREVIEW>
  105. <!-- START OF SCRIPT -->
  106. <!-- Step 1: Insert the following into the <head> section of your page. You can change the color of the strips from green to another by changing all three instances of the word "green" to another color name: -->
  107. <style>
  108. <!--
  109. .intro{
  110. position:absolute;
  111. left:0;
  112. top:0;
  113. layer-background-color:green;
  114. background-color:green;
  115. border:0.1px solid green;
  116. z-index:10;
  117. }
  118. -->
  119. </style>
  120. <!-- Step 2: Finally, insert the below right after the <body> tags, before anything else. You can adjust the speed in which the curtain "draws' by changing "speed=20" in the second line to another number (greater is faster): -->
  121. <div id="i1" class="intro"></div><div id="i2" class="intro"></div><div id="i3"
  122. class="intro"></div><div id="i4" class="intro"></div><div id="i5" class="intro"></div><div
  123. id="i6" class="intro"></div><div id="i7" class="intro"></div><div id="i8" class="intro"></div>
  124. <script language="JavaScript1.2">
  125.  
  126. /*
  127. Top-Down Curtain Script- ⌐ Dynamic Drive (www.dynamicdrive.com)
  128. For full source code, 100's more free DHTML scripts, and TOS,
  129. visit http://www.dynamicdrive.com
  130. */
  131.  
  132. var ns4=document.layers?1:0
  133. var ie4=document.all?1:0
  134. var ns6=document.getElementById&&!document.all?1:0
  135.  
  136. var speed=20
  137. var temp=new Array()
  138. var temp2=new Array()
  139. if (ns4){
  140. for (i=1;i<=8;i++){
  141. temp[i]=eval("document.i"+i+".clip")
  142. temp2[i]=eval("document.i"+i)
  143. temp[i].width=window.innerWidth/8-0.3
  144. temp[i].height=window.innerHeight
  145. temp2[i].left=(i-1)*temp[i].width
  146. }
  147. }
  148. else if (ie4||ns6){
  149. var clipbottom=ns6?window.innerHeight:document.body.offsetHeight
  150. cliptop=0
  151. for (i=1;i<=8;i++){
  152. temp[i]=ns6?document.getElementById("i"+i).style:eval("document.all.i"+i+".style")
  153. temp[i].width=ns6?window.innerWidth/8-2:document.body.clientWidth/8
  154. temp[i].height=ns6?window.innerHeight:document.body.offsetHeight
  155. temp[i].left=(i-1)*parseInt(temp[i].width)
  156. }
  157. }
  158. function openit(){
  159. window.scrollTo(0,0)
  160. if (ns4){
  161. for (i=1;i<=8;i=i+2)
  162. temp[i].bottom-=speed
  163. for (i=2;i<=8;i=i+2)
  164. temp[i].top+=speed
  165. if (temp[2].top>window.innerHeight)
  166. clearInterval(stopit)
  167. }
  168. else if (ie4||ns6){
  169. clipbottom-=speed
  170. for (i=1;i<=8;i=i+2){
  171. temp[i].clip="rect(0 auto "+clipbottom+" 0)"
  172. }
  173. cliptop+=speed
  174. for (i=2;i<=8;i=i+2){
  175. temp[i].clip="rect("+cliptop+" auto auto auto)"
  176. }
  177. if (clipbottom<=0){
  178. if (ns6){
  179. for (i=1;i<=8;i++)
  180. temp[i].display="none"
  181. }
  182. clearInterval(stopit)
  183. }
  184. }
  185. }
  186. function gogo(){
  187. stopit=setInterval("openit()",100)
  188. }
  189. gogo()
  190. </script>
  191.  
  192.  
  193. <!-- END OF SCRIPT -->
  194. <!/PREVIEW>
  195.  
  196. <!RELATED>NONE<!/RELATED>